#region MIT Licence
/*
 * Copyright (C) 2014 PdfCreative
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
 * and associated documentation files (the "Software"), to deal in the Software without restriction, 
 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 
 * sublicense, and/or sell copies of the Software, and to permit persons to whom 
 * the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included 
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 
 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#endregion

using System;

namespace PdfCreative.Pdf.Writer
{
    /// <summary>
    /// The PdfImage class encapsulates information for an image resource to embed in a PDF document.
    /// This is not the same as information on the image itself, such as the number of pixels or its colour depth, but just the
    /// parts that identify the image within the document, and information to locate the image on the system.
    /// Clients don't need to construct a PdfImage instance themselves; to add an image to a PDF document, call the
    /// CreateImage() method on a Writer instance.
    /// </summary>
    [Serializable]
    public class PdfImage : PdfResourceReference
    {
        // Private fields
        // ==============
        #region Private fields
        private string _filename;
        #endregion



        // Public properties
        // =================
        #region Public properties
        /// <summary>
        /// Sets or retrieves the file name of the image.
        /// </summary>
        public string Filename
        {
            get { return _filename; }
            set { _filename = value; }
        }

        /// <summary>
        /// Retrieves the object reference for this resource.
        /// </summary>
        public override string ResourceType
        {
            get { return "XObject"; }
        }
        #endregion



        // Public constructor
        // ==================
        #region Public constructor
        /// <summary>
        /// Constructs a new PdfImage instance.
        /// </summary>
        /// <param name="image">The image object reference</param>
        /// <param name="identifier">The image identifier</param>
        /// <param name="filename">The image's filename</param>
        public PdfImage(PdfObjectReference image, string identifier, string filename) :
            base(image, identifier)
        {
            _filename = filename;
        }
        #endregion
    } // PdfImage class
}
